/**
 * 
 */
package com.rf.richfitwheel.admin.sys.service;

import java.util.Map;

import com.rf.richfitwheel.admin.sys.model.SysMsgStream;
import com.rf.richfitwheel.admin.sys.vo.UserVO;
import com.rf.richfitwheel.common.utils.PageUtils;

/**
 * @author hushouquan
 *
 */
public interface SysMsgStreamService {
	
	/**
     *  发送消息接口
     * @param params {"senderId":发送用户id,"pageParam":页面参数,"msgCode":消息定义编码,"businessId":业务id,"msgContext":消息内容,"msgContextParam":消息内容参数}
     * @return
     */
    public boolean sendMsg(Map<String, Object> params) throws Exception;
    
    /**
     * 查询未读消息
     * @param params
     * @return
     */
    PageUtils queryUndealMsg(Map<String, Object> params, UserVO userVO);

    /**
     * 查询消息
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);
    
    
    /**
     * 主键获取
     * @param id
     * @return
     * @throws Exception
     */
    public SysMsgStream selectById(String id) throws Exception;

    /**
     * 主键获取
     * @param id
     * @return
     * @throws Exception
     */
    public SysMsgStream selectMapById(String id) throws Exception;

    
    /**
     * 新增消息
     * @param sysMsgStream
     */
    public void save(SysMsgStream sysMsgStream);

    /**
     * 更新信息
     * @param sysMsgStream
     */
    public void update(SysMsgStream sysMsgStream);


    /**
     * 删除信息
     * @param ids
     */
    public void deleteBatch(String[] ids);
    
    /**
     * 获取接收人未读的消息数
     * @param receiverId
     * @return
     */
    int getUndealMsgNum(String receiverId,String tenantId);

    /**
     * 标记为已读
     * @param ids
     */
    void deal(String[] ids);
    
    /**
     * 给下级机构的角色发消息
     *
     * @param orgCode    机构编码
     * @param roleIds    角色id数组
     * @param message    消息内容
     * @param businessId 业务id
     */
    void sendMsgToChildrenOrgRole(String orgCode, String[] roleIds, String message, String businessId) throws Exception;
}
